<template>
  <div>
    <el-form :model="form" label-width="120px">
      <el-form-item label="姓名">
        <el-input v-model="form.username" />
      </el-form-item>
      <el-form-item label="身份证号码">
        <el-input v-model="form.usernumber" />
      </el-form-item>
      <el-form-item label="户号">
        <el-input v-model="form.homeId" />
      </el-form-item>
      <el-form-item>
        <el-button>取消</el-button>
        <el-button type="primary" @click="onSubmit">提交</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script setup>
import { reactive } from 'vue'
import { addUserToHuji,removeUserOfHuji} from '@/api/huji'
import { ElMessage } from 'element-plus'
// do not use same name with ref
const form = reactive({
  username: '',
  usernumber: '',
  homeId: '',
  relationship:'',
  inOrOut:'迁入'
})

const onSubmit = () => {
  removeUserOfHuji(form).then((response)=>{
    if(response.code == 2000){
      ElMessage({
        message: response.data,
        type: 'success',
      })
    }else{
      ElMessage.error(response.data)
    }
  })
}
</script>

<style scoped>

</style>
